home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / recent13.lha / Install_RECENT.rexx next >
OS/2 REXX Batch file  |  1995-12-15  |  3KB  |  91 lines

  1. /*
  2. $VER: RECENT_Install v1.1 (15 Dec 95)
  3. */
  4. options results
  5.  
  6. program = 'RECENT'
  7. pig_lib = 'apig.library'
  8. pig_ver = '3.3'
  9.  
  10. cls  = '0C0A'x
  11. bell = '07'x
  12. nl   = '0A'x
  13.  
  14. call open(Shell,'con:0/11/640/60/ 'program'_Install v1.1  -  DFD Ltd.')
  15.  
  16. if ~show('L','rexxsupport.library') then do
  17.   if addlib('rexxsupport.library',0,-30,0) then nop
  18.   else do
  19.     call writeln Shell,cls||center('LIBS:rexxsupport.library is not available.',76)
  20.     exit 10
  21.   end
  22. end
  23.  
  24. if exists('LIBS:'pig_lib) then do
  25.   shell command('version >ram:ver LIBS:'pig_lib)
  26.   call open(x,'ram:ver','R')
  27.   old_ver = word(readln(x),2)
  28.   call close x
  29.   call delete('ram:ver')
  30.   if old_ver < pig_ver then do
  31.     call writeln Shell,cls||center('Updating LIBS:'pig_lib' v.'old_ver' to v.'pig_ver,76)
  32.     shell command('copy >nil: libs/'pig_lib' LIBS: clone')
  33.   end
  34. end
  35.  
  36. if ~exists('LIBS:'pig_lib) then do
  37.   call writeln Shell,cls||center('Copying libs/'pig_lib' v.'pig_ver' to LIBS:',76)
  38.   shell command('copy >nil: libs/'pig_lib' LIBS: clone')
  39. end
  40.  
  41. if ~show('L','apig.library') then do
  42.   if addlib('apig.library',0,-30,0) then nop
  43.   else do
  44.     call writeln Shell,cls||center('LIBS:apig.library is not available.',76)
  45.     exit 10
  46.   end
  47. end
  48.  
  49. call SET_APIG_GLOBALS()
  50. freq = ALLOCFILEREQUEST()
  51. call writeln Shell,cls||center('Where do you want to install 'program'?',76)
  52. install_path = REQUESTFILE(freq,0,0,'Where to install 'program,null(),null(),1,1,null(),0,22,320,177,null())
  53. call FREEFILEREQUEST(freq)
  54. if install_path = null() then signal Die
  55.  
  56. call writeln Shell,cls||center('Installing 'program,76)
  57. shell command('copy >nil: 'program' 'install_path' clone')
  58. call writeln Shell,cls||center('Installing Run_Script & Icon',76)
  59. shell command('copy >nil: Run_'program'#? 'install_path' clone')
  60.  
  61. call makedir('ENV:DFD')
  62. call makedir('ENVARC:DFD')
  63.  
  64. if exists('ENV:'program'.prefs') then do
  65.   call writeln(Shell,cls||center('Moving your ENV:'program'.prefs to ENV:DFD/',76))
  66.   shell command('copy >nil: ENV:'program'.prefs ENV:DFD clone')
  67.   call writech(Shell,nl' Delete ENV:'program'.prefs (y/N) ? ')
  68.   response = readch(Shell,1)
  69.   if upper(response) = 'Y' then call delete('ENV:'program'.prefs')
  70.   if exists('ENVARC:'program'.prefs') then do
  71.     call writeln(Shell,cls||center('Moving your ENVARC:'program'.prefs to ENVARC:DFD/',76)
  72.     shell command('copy >nil: ENVARC:'program'.prefs ENVARC:DFD clone')
  73.     call writech(Shell,nl' Delete ENVARC:'program'.prefs (y/N) ? ')
  74.     response = readch(Shell,1)
  75.     if upper(response) = 'Y' then call delete('ENVARC:'program'.prefs')
  76.   end
  77. end
  78.  
  79. call writeln(Shell,cls||center('- Install to "'install_path'" Complete -',76))
  80. say program' was installed in >> 'install_path
  81. call Ret
  82.  
  83. Die:
  84. call close Shell
  85. exit
  86.  
  87. Ret:
  88. call writech(Shell,nl' Press Return ')
  89. call readch(Shell,1)
  90. return
  91.